From: Joan Torres Lopez Date: Wed, 25 Feb 2026 13:19:41 +0000 (+0100) Subject: environment: Keep cleanup symmetrical with prepare in ease functions X-Git-Tag: archive/raspbian/50.5-1+rpi1^2~9^2^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=aa55ec1da2d5a3076e70e42e515e23209e715aa4;p=gnome-shell.git environment: Keep cleanup symmetrical with prepare in ease functions Add a guard to prevent cleanup() from running when prepare() was never called. Currently cleanup() is called when "stopped" is emitted (which ensures prepare() was called), in next commits cleanup will be called from different events which means prepare() may not have been called. Part-of: (cherry picked from commit 841ff6cfa247e69ed2c466c880846d1cceb3eece) --- diff --git a/js/ui/environment.js b/js/ui/environment.js index 45dafa9a7..0e0ab2f33 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -85,11 +85,15 @@ function _makeEasePrepareAndCleanup(duration) { if (!duration) return {prepare: null, cleanup: null}; + let canCleanup = false; const prepare = () => { global.compositor.disable_unredirect(); global.begin_work(); + canCleanup = true; }; const cleanup = () => { + if (!canCleanup) + return; global.compositor.enable_unredirect(); global.end_work(); };